interface DicType {
  label: string;
  value: string | number;
  key: string | number;
}

export default function (dicTypes: DicType[]) {
  const labelValueHash = {};
  for (const item of dicTypes) {
    labelValueHash[item.value] = item.label;
  }
  return function (value: string | number) {
    return labelValueHash[value] || '无';
  };
}
